package com.lee.dhsg.dao;


import com.lee.dhsg.domain.Catalog;
import com.lee.dhsg.domain.Category;
import com.lee.dhsg.domain.Course;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author Jun
 */
@Component
@Mapper
public interface CatalogDao {

    /**
     * 通过课程id 查询某一个课程的一级目录
     *
     */
    @Select("select * from catalog where fcatalogid is null and courseid=#{courseid}")
    List<Catalog> selectFcatalogByCourseid(Integer courseid);

    /**
     * 通过 fcatalogid 查询其子目录
     */
    @Select("select * from catalog where fcatalogid=#{fcatalogid}")
    List<Catalog> selectCatalogByFcatalogid(Integer fcatalogid);


}
